diff --git a/django/utils/translation/trans_real.py b/django/utils/translation/trans_real.py
index 46a94b99ff..b38e5f9837 100644
--- a/django/utils/translation/trans_real.py
+++ b/django/utils/translation/trans_real.py
@@ -535,12 +535,12 @@ def get_language_from_path(path, strict=False):
     """
     regex_match = language_code_prefix_re.match(path)
     if not regex_match:
-        return None
+        return settings.LANGUAGE_CODE
     lang_code = regex_match[1]
     try:
         return get_supported_language_variant(lang_code, strict=strict)
     except LookupError:
-        return None
+        return settings.LANGUAGE_CODE
 
 
 def get_language_from_request(request, check_path=False):
